import Vue from 'vue'
import Router from 'vue-router'
import Login from '../views/Login'
import DashBoard from '../views/DashBoard'

Vue.use(Router);

const routes = [
    {path: '/', redirect: '/login'},
    {path: '/login', component: Login},
    {path: '/dashboard', component: DashBoard, meta: {needLogin: true}}
];

const mainRouter = new Router({routes});

mainRouter.beforeEach((to, from, next) => {
    next();
});

export default mainRouter;
